generate an array with random numbers in a range java

56

generate an array with random numbers in a range java -

import java.util.concurrent.ThreadLocalRandom;

// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);

Comments

Submit
0 Comments